home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / src / rpclib / rpc_dtablesize.c < prev    next >
C/C++ Source or Header  |  1994-03-09  |  2KB  |  63 lines

  1. /*
  2.  * $Id: rpc_dtablesize.c,v 1.3 1994/02/26 18:54:09 jraja Exp $
  3.  *
  4.  * $Log: rpc_dtablesize.c,v $
  5.  * Revision 1.3  1994/02/26  18:54:09  jraja
  6.  * Removed AMITCP_20_TEMP_FIX.
  7.  *
  8.  * Revision 1.2  1993/11/10  02:35:47  jraja
  9.  * Fixed includes.
  10.  * Added _temporary_ fix for missing getdtablesize() for the AmiTCP 2.x.
  11.  *
  12.  */
  13. /* @(#)rpc_dtablesize.c    2.1 88/07/29 4.0 RPCSRC */
  14. /*
  15.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  16.  * unrestricted use provided that this legend is included on all tape
  17.  * media and as a part of the software program in whole or part.  Users
  18.  * may copy or modify Sun RPC without charge, but are not authorized
  19.  * to license or distribute it to anyone else except as part of a product or
  20.  * program developed by the user.
  21.  * 
  22.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  23.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  24.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  25.  * 
  26.  * Sun RPC is provided with no support and without any obligation on the
  27.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  28.  * modification or enhancement.
  29.  * 
  30.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  31.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  32.  * OR ANY PART THEREOF.
  33.  * 
  34.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  35.  * or profits or other special, indirect and consequential damages, even if
  36.  * Sun has been advised of the possibility of such damages.
  37.  * 
  38.  * Sun Microsystems, Inc.
  39.  * 2550 Garcia Avenue
  40.  * Mountain View, California  94043
  41.  */
  42. #if !defined(lint) && defined(SCCSIDS)
  43. static char sccsid[] = "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
  44. #endif
  45.  
  46. #include <sys/param.h>
  47. #include <sys/socket.h>
  48.  
  49. /*
  50.  * Cache the result of getdtablesize(), so we don't have to do an
  51.  * expensive system call every time.
  52.  */
  53. int 
  54. _rpc_dtablesize(void)
  55. {
  56.     static int size;
  57.     
  58.     if (size == 0) {
  59.         size = getdtablesize();
  60.     }
  61.     return (size);
  62. }
  63.